﻿<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta name="viewport" content="width=device-width" />
    <title>浏览文件内容</title>
    <link href="../lib/layui/css/layui.min.css" rel="stylesheet" />
    <link href="../x-admin/css/font.css" rel="stylesheet" />
    <link href="../x-admin/css/xadmin.css" rel="stylesheet" />
    <script type="text/javascript" src="../lib/layui/layui.js"></script>
</head>
<body>
    <div class="layui-card-body" style="">
        <pre></pre>
    </div>
    <script type="text/javascript">
        function getrequest() {
            var url = location.search; //获取url中"?"符后的字串
            var theRequest = new Object();
            if (url.indexOf("?") != -1) {
                var str = url.substr(1);
                strs = str.split("&");
                for (var i = 0; i < strs.length; i++) {
                    theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
                }
            }
            return theRequest;
        }
        layui.jquery.ajax({
            url: localStorage.getItem('hosttingaddr')+"/api/DelicacyCfgFile/detail?fileName=" + getrequest().fileName,
            method: "GET",
            success: function (content) {
                layui.jquery("pre").text(content);
            },
            error: function (jqXHR, textStatus, errorThrown) {
                layer.msg("打开文件失败！错误消息为：" + errorThrown);
            }
        });
    </script>
</body>
</html>